package com.magina.mq.rabbit.queue;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class RabQueueSender {

    @Autowired
    private AmqpTemplate rabbitTemplate;

    @Value("${rab.queueName}")
    private String rabQueueName;

    public void send(Integer i){
        String msg = "rabbitMq send queue msg: count :" + i;
        this.rabbitTemplate.convertAndSend(rabQueueName,msg);
    }

}
